package com.example.enums;

/**
 * @Author: wyp
 * @Date: 2021/9/9 18:08
 */
public enum PeopleEnum {
    xiaowang(1,"小王"),xiaoli(2,"小李"),xiaoxin(3,"小新"),xiaochen(4,"小陈"),xiaojiang(5,"小江"),
    xiaohe(6,"小何"),xiaosi(7,"小四"),xiaozhou(8,"小周"),xiaowu(9,"小吴"),xiaoguo(0,"小郭");

    private int id;
    private String name;

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    PeopleEnum(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static PeopleEnum getName(int i){
        PeopleEnum[] values = PeopleEnum.values();
        for (PeopleEnum value : values) {
            if(i==value.getId()){
                return value;
            }
        }
        return null;
    }
}
